home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / qwik41.arc / CURSOR.DOC next >
Text File  |  1989-06-12  |  6KB  |  110 lines

  1. { Cursor.doc - documentation for QWIK cursor routines       ver 4.1, 05-01-88 }
  2.  
  3.   GotoRC - Like Turbo's GotoXY, this procedure moves the cursor, but with a 
  4.   couple of important differences.  The cursor is absolute to the entire 
  5.   screen and ignores the limits set by the Turbo Window procedure.  In 
  6.   addition, it will work on all the other video pages besides page 0.
  7.  
  8.   CursorChange - This procedure will let you change the mode (shape and 
  9.   visibility) of the cursor.  At the same time, it saves the previous mode.  
  10.   Using hex is the easiest way to set the integer.  The shape of the cursor 
  11.   is defined by horizontal scan lines in the character cell where the top row 
  12.   is of any cell is 0.  The starting (upper) row of the cursor mode is the 
  13.   high (or left) byte of the integer and the ending (lower) row is the low 
  14.   (or right) byte.  In addition, bits 5 and 6 of the starting row byte 
  15.   control on/off and erratic blinking (remember a byte has bits 0 to 7).  See 
  16.   QINIT.DOC for cell sizes.
  17.  
  18.      Shape:       Adapter   Default  Comments
  19.                   --------  -------  -------------------------
  20.                   MDA       $0B0C
  21.                   CGA,MCGA  $0607
  22.                   EGA       $0B0C    MD, ECD (640x350 25-line)
  23.                   EGA       $0607    CD, ECD (640x200)
  24.                   VGA       $0D0E    Emulation off
  25.                   3270 PC   $0D0D    And converts MDA and CGA
  26.  
  27.      Cursor off:  Set start row bits 6-5 = 01.  All other bits don't matter.
  28.      Blinking:    Set start row bits 6-5 = 11.  Creates erratic blinking on 
  29.                   most machines.
  30. |    Skew:        Set end bits 6-5 = 01, 10, or 11 on EGA or VGA to skew the 
  31. |                 cursor to the right by 1, 2, or 3 spaces respectively.
  32.  
  33.      Suggestions: For block cursor,  set New:=$000E (Works on all machines.)
  34.                   For hidden cursor, set New:=$2000
  35.  
  36.   CursorOff - Rather than using CursorChange to hide the cursor, use this 
  37.   procedure.  You don't have to save the current cursor shape since all it 
  38.   does is set the cursor-off bit on the current cursor mode.
  39.  
  40.   CursorOn - To restore the cursor after turning it off with CursorOff, use 
  41.   this procedure.  The previous shape is maintained.
  42.  
  43.   WhereR/WhereC - Also like Turbo's WhereX/WhereY, these functions detect 
  44.   cursor position, but with the same differences as GotoRC.
  45.  
  46.   Suggestions - Use discretion when changing the cursor mode.  Some users 
  47.   prefer a block cursor for all their applications.  If your program forces 
  48.   it to an underline, try to restore the original cursor.  Programs like 
  49.   WordStar, never even touch the cursor.  There is only one case that I know 
  50.   where you must set the cursor mode before using CursorOff/On.  The early 
  51.   PCs had a bug in the BIOS that set the MDA default to be CGA instead.  You 
  52.   can check for ActiveDispDev=MdaMono and a $0607 cursor.  If so, change it 
  53.   to $0B0C for an underline.
  54.  
  55.   EGA Cursor Emulation - With 640x200, the emulation works fairly well.  With 
  56.   640x350 and 25-line mode, the emulation works, too.  Outside of that, it is 
  57.   suggested that any needed changes should be made with emulation off which 
  58.   can be done be setting bit 0 of EgaInfo equal to 1.
  59.  
  60.   MCGA Cursor Emulation - Use the CGA cursor cell size even though the 
  61.   character cell is 8x16.  The BIOS multiplies the start and end rows by 2 
  62.   and then adds one to the end row before writing to the hardware video port 
  63.   to emulate the CGA.
  64.  
  65.   VGA Cursor Emulation - Qinit sets the cursor emulation mode on so you don't 
  66.   have to worry about special fonts and cells sizes.  The only cell sizes you 
  67.   need to know is the MDA and CGA.  The video BIOS will adjust your cursor 
  68.   shape to fit in the current cell size.  Here's the cursor shapes (types) 
  69.   recognized by the VGA algorithm and how it responds:
  70.  
  71.      Cursor Type   Condition            Action
  72.      ------------  -------------------  ---------------
  73.      Hidden (off)  start bits 6-5 = 01  pass
  74.      Split         start > end          invert to block
  75.      Overbar       start < end <= 3     pass
  76.      Underline     start+2 >= end       adjust
  77.      Full-block    start <= 2           adjust
  78.      Half-block    start > 2            adjust
  79.  
  80.  
  81.   For adjustment, three more tests are required:
  82.  
  83.      Condition                          Action
  84.      --------------------------------   ----------
  85.      start or end >= cell height        adjust
  86.      end = cell height - 1              pass
  87.      start = cell height - 2            pass
  88.  
  89.  
  90.   The final adjustment is made to the corresponding cursor type:
  91.  
  92.      Cursor Type  Adjustment
  93.      -----------  -------------------------------------------------
  94.      Overbar      pass
  95.      Underline    move start/end to bottom of cell
  96.      Half-block   start = cell height/2; move end to bottom of cell
  97.      Full-block   move end to bottom of cell
  98.  
  99.  
  100.   3270 PC Peculiarites - The 3270 PC cursor types are limited to only three.  
  101.   In addition, the underline cursor is not visible on a white background on 
  102.   the 5272 color display and it is advisable to use a block cursor together 
  103.   with that attribute:
  104.  
  105.      Cursor Type   Comments
  106.      ------------  ---------------------------------------------------
  107.      Underline     $0D0D only.  CGA and MDA are emulated to this type.
  108.      Hidden (off)  cursor start > cursor end.  $2000 is preferred.
  109.      Block         anything other than the above
  110.